
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%@page import="com.tss.util.*"%>
<%@page import="com.jedi.*"%>
<%@page import="com.store.*"%>
<%@page import="java.util.*"%>
<%@page import="java.text.*"%>
<%@include file="../global_var.jsp"%>
<%@include file="../check_login.jsp"%>
<%
User user = (User)session.getAttribute("LoginUser");
MessageMgr msgMgr = new MessageMgr();
String id = ParamUtils.getParameter(request,"id","");

String strErr = "";
Message msg = msgMgr.get(id);
if (msg == null || msg.getId().trim().equals("")) strErr = "要删除的咨询信息不存在!";

User just_user = (User)session.getAttribute("LoginUser");
if (!just_user.hasPower("10808")) {
	if (msg == null || !msg.getAuthorId().equals(user.getId())) {
		strErr = "对不起，您没有此权限!";
	}
}

if (strErr.trim().equals("")) {
	msg.delete();
	if (msg.hasErr()) strErr = msg.getErrHtml();
}

if (strErr.trim().equals("")) {
%>
<script language="javascript">
try {
	parent.pageForm.submit();
}
catch(ex) {
	//alert(ex.description);
}
</script>
<%}else{%>
<script language="javascript">
alert("<%=strErr%>");
</script>
<%}%>